Skip to content

Conversation

@arya2004
Copy link
Contributor

@arya2004 arya2004 commented May 9, 2025

This PR resolves #335.

Summary

Fixes a bug where the configuration line appended to .bashrc by inshellisense lacks a trailing newline. This results in broken command concatenation if another tool (e.g., CUDA) appends config lines immediately after.

What Changed

In src/commands/init.ts, added an explicit trailing newline to the config output:

process.stdout.write(`\n\n${config}\n`);

Why It Matters

Without a newline, tools appending shell config to .bashrc (e.g., CUDA) may cause a malformed entry like:

[ -f ~/.inshellisense/bash/init.sh ] && source ~/.inshellisense/bash/init.shexport PATH=...

This breaks shell startup and leads to errors like:

bash: /home/user/.inshellisense/bash/init.shexport: No such file or directory

Environment

  • OS: Ubuntu 24.04.2 LTS
  • Shell: Bash 5.2.21
  • Node: 22.15.0
  • is version: 0.0.1-rc.20

Copy link
Member

@cpendery cpendery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good change, but the inshellisense plugin should come last in the user's .bashrc or it'll get flagged (I think) by the is doctor command

@cpendery cpendery merged commit 5cac2d7 into microsoft:main May 21, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing trailing newline in .bashrc entry causes 'No such file or directory' error when sourcing Inshellisense's init.sh

2 participants